giveVon = function(intUserId) {
	$.getJSON(				
		HOST_VFRIEND + 'ajax/uivon?uid='+intUserId+'&callback=?',		
		function(response) {					
			var msg	= response['msg'];
			if(response['error'] == 0) {				
				$.blockUI({
					message: msg, 
					css: { 
						textAlgin:'left',
						background:'none',
						border: 'none',
						width:'300px', 
						top: (($(window).height()-300)/2) + 'px', 
						left:(($(window).width()-300)/2) + 'px',
						cursor: 'default',
						zIndex: '10001'
					},
					overlayCSS: {
						cursor: 'default',
						zIndex: '10000'
					}
				});
			} else {
				alert(msg);
			}
		}
	);
}
giveLike = function(intUserId) {
	$.getJSON(				
		HOST_VFRIEND + 'ajax/uilike?uid='+intUserId+'&callback=?',		
		function(response) {					
			var msg	= response['msg'];
			if(response['error'] == 0) {				
				$.blockUI({
					message: msg, 
					css: { 
						textAlgin:'left',
						background:'none',
						border: 'none',
						width:'300px', 
						top: (($(window).height()-300)/2) + 'px', 
						left:(($(window).width()-300)/2) + 'px',
						cursor: 'default',
						zIndex: '10001'
					},
					overlayCSS: {
						cursor: 'default',
						zIndex: '10000'
					}
				});
			} else {
				alert(msg);
			}
		}
	);
}
addBlacklist = function(intUserId) {
	$.getJSON(				
		HOST_VFRIEND + 'ajax/uiblacklist?uid='+intUserId+'&callback=?',		
		function(response) {							
			var msg	= response['msg'];			
			if(response['error'] == 0) {				
				$.blockUI({
					message: msg, 
					css: { 
						textAlgin:'left',
						background:'none',
						border: 'none',
						width:'300px', 
						top: (($(window).height()-300)/2) + 'px', 
						left:(($(window).width()-300)/2) + 'px',
						cursor: 'default',
						zIndex: '10001'
					},
					overlayCSS: {
						cursor: 'default',
						zIndex: '10001'
					}
				});
			} else {
				alert(msg);
			}
		}
	);
}
cancelFriend = function(intUserId, intType) {
	$.getJSON(				
		HOST_VFRIEND + 'ajax/uicancelfriend?uid='+intUserId+'&type='+intType+'&callback=?',		
		function(response) {							
			var msg	= response['msg'];			
			if(response['error'] == 0) {
				if(intType == 3) {
					$.blockUI({
						message: msg, 
						css: { 
							textAlgin:'left',
							background:'none',
							border: 'none',
							width:'400px', 
							top: (($(window).height()-400)/2) + 'px', 
							left:(($(window).width()-400)/2) + 'px',
							cursor: 'default',
							zIndex: '10001'
						},
						overlayCSS: {
							cursor: 'default',
							zIndex: '10000'
						}
					});
					$('#scrollDivorce').jScrollPane();	
				} else {
					$.blockUI({
						message: msg, 
						css: { 
							textAlgin:'left',
							background:'none',
							border: 'none',
							width:'300px', 
							top: (($(window).height()-300)/2) + 'px', 
							left:(($(window).width()-300)/2) + 'px',
							cursor: 'default',
							zIndex: '10001'
						},
						overlayCSS: {
							cursor: 'default',
							zIndex: '10000'
						}
					});
				}
			} else {
				alert(msg);
			}
		}
	);
}
sellGift = function(intId, strTargetId, strToken, intType, intRefObjId) {
	if(intType == 0) {
		var strLink	= HOST_VFRIEND + 'request/gsell?fgiftid='+intId+'&uid='+strTargetId+'&token='+strToken+'&callback=?';
	} else {
		var strLink	= HOST_VFRIEND + 'request/accepted?requestid='+intId+'&uid='+strTargetId+'&refobjid='+intRefObjId+'&type=10&token='+strToken+'&callback=?';
	}
	$.getJSON(				
		strLink,		
		function(response) {
			var msg = response['msg'];			
			if(response['error'] == 0) {
				if(intType == 0) {
					$('#sGift').html(response['data']);
				} else {
					$('#divReContent').html(response['data']);
				}
				showUIMessage(msg);				
				if(response['von'] != '0') {
					$('#nVon').html(response['von']);
				}
			} else {
				alert(msg);
			}
		}
	);
}
acceptGift = function(intFgiftId,strTargetId,strToken) {
	$.getJSON(				
		HOST_VFRIEND + 'request/gaccepted?fgiftid='+intFgiftId+'&uid='+strTargetId+'&token='+strToken+'&callback=?',		
		function(response) {					
			var msg 	= response['msg'];	
			var error	= response['error'];
			if(error == 0) {
				showUIMessage(msg);
				$('#sGift').html(response['data']);
			} else {
				if(error == 36) {
					$('#sGift').html(response['data']);
					var secret = response['secret'];
					if(confirm(msg) == true) {
						sellGift(intFgiftId,strTargetId,secret,0,0);
					}
				} else {
					alert(msg);
				}
			}
		}
	);
}
deniGift = function(intFgiftId,strTargetId,strToken) {
	$.getJSON(				
		HOST_VFRIEND + 'request/gdenied?fgiftid='+intFgiftId+'&uid='+strTargetId+'&token='+strToken+'&callback=?',		
		function(response) {					
			showUIMessage(msg);
			var msg = response['msg'];			
			if(response['error'] == 0) {				
				$('#sGift').html(response['data']);
				if(response['von'] != '0') {
					$('#nVon').html(response['von']);
				}
			} else {
				alert(msg);
			}
		}
	);
}
deleteGift = function(intFgiftId,strTargetId,strToken) {
	if(confirm(confirm_delete_gift) == true) {
		$.getJSON(				
			HOST_VFRIEND + 'request/gdelete?fgiftid='+intFgiftId+'&uid='+strTargetId+'&token='+strToken+'&callback=?',		
			function(response) {
				var msg 	= response['msg'];			
				var error	= response['error'];			
				if(error == 0) {
					$('#sGift').html(response['data']);
					showUIMessage(msg);					
				} else {
					if(error == 39) {
						$('#sGift').html(response['data']);						
					}
					alert(msg);
				}
			}
		);
	}
}
reAccepted = function(intRequestId,intRequesterId,intRefObjId,intType,strToken) {	
	$.getJSON(				
		HOST_VFRIEND + 'request/accepted?requestid='+intRequestId+'&uid='+intRequesterId+'&refobjid='+intRefObjId+'&type='+intType+'&token='+strToken+'&callback=?',		
		function(response) {	
			var msg 	= response['msg'];		
			var error	= response['error'];
			var data	= response['data'];
			if(error== 0) {
				$('#divReContent').html(data);
				showUIMessage(msg);				
				if(response['von'] != '0') {
					$('#nVon').html(response['von']);
				}
			} else {
				if(error == 36) {
					var secret = response['token'];
					if(confirm(msg) == true) {
						sellGift(intRequestId,intRequesterId,secret,1,intRefObjId);
					}
				} else {
					$('#divReContent').html(data);
					alert(msg);
				}
			}
		}
	);
}
reDenied = function(intRequestId,intRequesterId,intRefObjId,intType,strToken) {
	$.getJSON(				
		HOST_VFRIEND + 'request/denied?requestid='+intRequestId+'&uid='+intRequesterId+'&refobjid='+intRefObjId+'&type='+intType+'&token='+strToken+'&callback=?',		
		function(response) {
			$('#divReContent').html(response['data']);
			var msg = response['msg'];
			if(response['error'] == 0) {	
				showUIMessage(msg);
			} else {
				alert(msg);
			}
		}
	);
}